package com.atguigu.gmall.list.client;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.list.client.impl.ListDegradeFeignClient;
import com.atguigu.gmall.model.list.SearchParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "service-list",fallback = ListDegradeFeignClient.class)
public interface ListFeignClient {

    //发布一个热度排名数据接口
    @GetMapping("api/list/inner/incrHotScore/{skuId}")
    Result incrHotScore(@PathVariable Long skuId);

    //商品的下架
    @GetMapping("inner/lowerGoods/{skuId}")
    Result lowerGoods(@PathVariable Long skuId);

    //商品检索 : web-all 能够接收到传递的参数：searchParam 需要一个远程调用{有可能需要传递多个数据，需要使用JSON 对象接收}
    @PostMapping("/api/list")
    Result list(@RequestBody SearchParam searchParam);

    //商品的上架
    @GetMapping("inner/upperGoods/{skuId}")
    Result upperGoods(@PathVariable Long skuId);
}
